#pragma once
#include "DXAMLCommon.h"
#include "CFrameworkElement.h"

class CItemsControl;
class CItemsPanelTemplate;

class CItemsPresenter :
	public CFrameworkElement
{

protected: 
	CItemsPresenter(CCoreServices * pCore);
protected: 
	virtual ~CItemsPresenter();
public: 
	static HRESULT Create(CDependencyObject * * ppObject, CREATEPARAMETERS * pCreate);
	virtual XUINT32 GetTypeIndex() const;
	virtual XINT32 CanHaveChildren();
	virtual XBOOL GetIsLayoutElement();
	virtual HRESULT AddChild(CUIElement * pChild);
	virtual HRESULT SetValue(CDependencyProperty * pdp, CValue * pValue);
protected: 
	virtual HRESULT ApplyTemplate(XBOOL & fAddedVisuals);
	virtual HRESULT MeasureOverride(struct XSIZEF availableSize, struct XSIZEF & desiredSize);
	virtual HRESULT ArrangeOverride(struct XSIZEF finalSize, struct XSIZEF & newFinalSize);
	virtual HRESULT OnApplyTemplate();
private: 
	HRESULT AddItemsHost(CItemsControl * pItemsControl);
public: 
	CItemsPanelTemplate * m_pItemsPanelTemplate; 
	struct XRECTF_RB m_padding;

};